#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int, int>
#define pil pair<int, ll>
#define pli pair<ll, int>
#define pll pair<ll, ll>

void solve(){
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> cnt2;
    for(int i = 0; i < n; i++){
    	cin >> a[i];
    	else cnt2.push_back(a[i]);
    }

    if(a[0] == 1){
    	cout << a[0] << ' ' << a[1] << '\n';
    	return;
    }
    if(cnt2.size() >= 2){
    	cout << cnt2[0] << ' ' << cnt2[1] << '\n';
    	return;
    }

    for(int i = 1; i < n; i++){
    }

    cout << "-1\n";
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int t=1;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}